package service;

import dao.BookMapper;
import pojo.Books;

import java.util.List;

public class BookServiceImpl implements BookService {

//    调用dao层的操作，设置一个set接口，方便Spring管理
    private BookMapper bookMapper;

    public void setBookMapper(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public int addBook(Books book) {
        return bookMapper.addBook(book);
    }

    public int deleteBookById(int articleId) {
        return bookMapper.deleteBookById(articleId);
    }

    public int updateBook(Books books) {
        return bookMapper.updateBook(books);
    }

    public Books queryBookById(int articleId) {
        return bookMapper.queryBookById(articleId);
    }

    public List<Books> queryAllBook() {
        return bookMapper.queryAllBook();
    }

    public List<Books> queryBook(String title) {
        return bookMapper.queryBook(title);
    }
}
